<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="_content/BulmaRazor/bulma.min.css" rel="stylesheet"/>
    <link href="_content/BulmaRazor/bulmarazor.min.css?v=1" rel="stylesheet"/>
    <script src="_content/BulmaRazor/bulmarazor.min.js"></script>
    <script src="_content/BulmaRazor/jsplugin/slider/bulma-slider.js"></script>
    <!--    <link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" rel="stylesheet"/>-->
    <link href="/css/site.css" rel="stylesheet"/>

    <style>
        .backtop {
            position: fixed;
            width: 40px;
            height: 40px;
            padding: 0 !important;
            display: none;
            font-size: 20px;
            z-index: 5;
            bottom: 40px;
            right: 40px;
        }
    </style>
</head>
<body class=" has-background-danger-light">

<button id="bt" class="backtop has-shadow button is-rounded">
    <span class="icon">
        <i class="fa fa-arrow-up"></i>
    </span>
</button>

<div class="container">

    <br>
    <div style="width:500px;height:500px;position: relative">

        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
    </div>

    <p>sdfsfa</p>
    <p>sdfsfa</p>
    <p>sdfsfa</p>
    <p>sdfsfa</p>
    <div style="width:500px;height:500px;position: relative">

        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
    </div>
    <div style="width:500px;height:500px;position: relative">
        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
    </div>
    <div id="scroll" style="border: 1px solid red; height:500px;overflow: auto">
        <div style="width:500px;height:500px;position: relative">

            <p>sdfsfa</p>
            <p>sdfsfa</p>
            <p>sdfsfa</p>
            <p>sdfsfa</p>
        </div>
        <div style="width:500px;height:500px;position: relative">

            <p>sdfsfa</p>
            <p>sdfsfa</p>
            <p>sdfsfa</p>
            <p>sdfsfa</p>
        </div>
        <div style="width:500px;height:500px;position: relative">

            <p>sdfsfa</p>
            <p>sdfsfa</p>
            <p>sdfsfa</p>
            <p>sdfsfa</p>
        </div>
    </div>
    <div style="width:500px;height:500px;position: relative">

        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
        <p>sdfsfa</p>
    </div>
    <div class="page-header" style="position: relative">

        <div class="page-header-left">
            <span class="icon page-header-icon">
                <i class="fa fa-angle-left"></i>
            </span>
            <span class="page-header-title">返回</span>
        </div>
        <div class="page-header-content">
            详细页面
        </div>
    </div>


</div>

<script>

    function initBackTop(id, target, visibilityHeight, time) {

        var $target = $(document);
        var isDocument = true;
        if (target) {
            isDocument = false;
            $target = $(target);
        }
        $target.scroll(function () {
            var top = $target.scrollTop();
            if (top > visibilityHeight) {
                $("#" + id).show();
            } else {
                $("#" + id).hide();
            }
        });
        $("#" + id).click(function () {
            if (isDocument) {
                $('html, body').animate({scrollTop: 0}, time);
            } else {
                $target.animate({scrollTop: 0}, time);
            }
        });
    }


    initBackTop('bt', '#scroll', 200, 200);

</script>
</body>
</html>